// run: $exec < input
#include <cstdio>
#include <set>
#include <utility>

std::set<std::pair<int, int>> out;

int const maxn = 100100;
int da[maxn];
int n, tot;

int judge(int x)
{
	int won[2], c[2];
	won[0] = won[1] = c[0] = c[1] = 0;
	for (int i = 0; i < n; i++) {
		c[da[i] - 1]++;
		if (c[da[i] - 1] == x) {
			c[da[i] - 1] = 0;
			c[2 - da[i]] = 0;
			won[da[i] - 1]++;
		}
	}
	if (c[0] || c[1]) return -1;
	if (da[n - 1] == 1 && won[0] > won[1]) return won[0];
	return -1;
}

int main()
{
	std::scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		std::scanf("%d", &da[i]);
		tot += da[i] == 1;
	}
	for (int i = 1; i * i <= tot; i++) {
		int t = judge(i);
		if (t != -1) out.insert({t, i});
		t = judge(tot / i);
		if (t != -1) out.insert({t, tot/i});
	}

	std::printf("%d\n", (int)out.size());
	for (auto i : out)
		std::printf("%d %d\n", i.first, i.second);
}

